<?php
require 'facebook.php';

$config = array();
$config['appId'] = '325010710922387';
$config['secret'] = 'ec564024e4afea8928d776fcd493cf81';
$facebook = new Facebook($config);

$uid = $facebook->getUser();

/*$con = mysql_connect("projectffcom.ipagemysql.com", "admin_user", "poghjk123"); 
mysql_select_db(main, $con);

$username = $_POST['username'];
$password = $_POST['password'];

//Protect against sql injection attacks
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);

$query = mysql_query("SELECT * FROM USER_INFO WHERE lower(USERNAME) = '$username' AND PASSWORD = MD5('$password')");

$row = mysql_fetch_array($query);
$num_rows = mysql_num_rows($query);

mysql_close($con);

if($num_rows == 0 || $num_rows > 1)
{
	header('Location: http://www.bsomaham.99k.org/error.html'); 
}

else
{		
	$_SESSION['username'] = $row['USERNAME'];
	header("Location: http://www.project-ff.com/trunk/main/main.php"); 
}*/


if ($uid) {
  try {
	header("Location: http://www.project-ff.com/trunk/main/main.php?uid=".$uid); 
	
  } catch (FacebookApiException $e) {
    $uid = null;
  }
} else {
  echo "shit";
}

?>